package baidu.testProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandler implements InvocationHandler {

	private Object obj;
	
	public MyInvocationHandler(Object obj){
		this.obj = obj;
	}
	
	public Object invoke(Object proxy, Method method, Object[] args)
			throws Throwable {
		System.out.println("Before invoke method.");
		Object result = method.invoke(obj, args);
		System.out.println("Invoke method After.");
		return result;
	}

}
